#!/usr/bin/env python
#-*- coding:utf-8 -*-

import csv

def toCSV(combo_box_1, combo_box_2, combo_box_3, combo_box_4, result):
	
	
	query = []
	if(combo_box_1.Enabled==True):
		query.append(combo_box_1.GetValue())
		if(combo_box_2.Enabled==True):
			query.append(combo_box_2.GetValue())
		if(combo_box_3.Enabled==True):
			query.append(combo_box_3.GetValue())
		if(combo_box_4.Enabled==True): 
			query.append(combo_box_4.GetValue())
	elif(combo_box_2.Enabled==True):
		query.append(combo_box_2.GetValue())
		if(combo_box_3.Enabled==True):
			query.append(combo_box_3.GetValue())
		if(combo_box_4.Enabled==True): 
			query.append(combo_box_4.GetValue())
	elif(combo_box_3.Enabled==True):
		query.append(combo_box_3.GetValue())
		if(combo_box_4.Enabled==True): 
			query.append(combo_box_4.GetValue())
	elif(combo_box_4.Enabled==True):
		query.append(combo_box_4.GetValue())
	
	query.append("resultado: " + result)
	
	spamWriter = csv.writer(open("pythonCSV.csv", 'a'), delimiter=',')
	
	spamWriter.writerow(query)
